<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background: pink;
            position: fixed;
            left: 50px;
            top: 50px;
        }

        /* 进来之前  */
        .animate-enter {
            left: 0;
            transform: rotate(1000deg);
        }

        /* 进来过程 */
        .animate-enter-active {
            transition: all .5s;
        }

        /* 进来完成 */
        .animate-enter-to {
            left: 300px;
            transform: rotate(0deg);
        }

        .animate-leave {
            left: 300px
        }

        .animate-leave-active {
            transition: all .5s;
        }

        .animate-leave-to {
            left: 1000px;
        }
    </style>
</head>
<body>
<div id="app">
    <button @click="show = !show">切换</button>
    <transition name="animate">
        <div class="box" v-show="show">
        </div>
    </transition>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            show: true
        }
    })
</script>
</body>
</html>